<?php
/**
 * 商机
 * @Author: wjf
 * @Date: 2022-12-01 15:51:52
 */

namespace app\crm\model\commercial;

use think\Model;

class Cllist extends Model
{
    /**
     * 设置当前模型对应的完整数据表名称 
     * @Author: wjf
     * @Date: 2022-11-26 15:03:14
    */ 
    protected $table = 'crm_business';
 
    public function setPredictTimeAttr($value)
    {
        return strtotime($value);
    }
    public function setFollowTimeAttr($value)
    {
        return strtotime($value);
    }
    public function getPredictTimeAttr($value)
    {
        return date('Y-m-d H:i:s',$value);
    }
    public function getFollowTimeAttr($value)
    {
        return date('Y-m-d H:i:s',$value);
    }
    public function getStatusAttr($value,$data)
    {
        $status = [0 => '洽谈中', 1 => '已成交'];
        return $status[$data['status']];
    }

    public function Ourclients()
    {
        return $this->belongsTo('app\crm\model\client\Ourclients','client_id','id');
    }
}